import { NgModule } from '@angular/core';
import { AuthGuard } from '@abp/ng.core';
import { Routes, RouterModule } from '@angular/router';
import { ItemCategoryDetailComponent } from './item-masters/item-category-detail/item-category-detail.component';
import { UnitListComponent } from './item-masters/unit-list/unit-list.component';
import { UnitGroupListComponent } from './item-masters/unit-group-list/unit-group-list.component';
import { ItemMasterListComponent } from './item-masters/item-master-list/item-master-list.component';
import { BillOfMaterialsListComponent } from './item-masters/bill-of-materials-list/bill-of-materials-list.component';
import { BomMasterListComponent } from './item-masters/bom-master-list/bom-master-list.component';
import { DepartmentDetailComponent } from './staff/department-detail/department-detail.component';
import { OperatorListComponent } from './staff/operator-list/operator-list.component';
import { CustomerTypeDetailComponent } from './customers/customer-type-detail/customer-type-detail.component';
import { CustomerListComponent } from './customers/customer-list/customer-list.component';
import { SupplierTypeDetailComponent } from './suppliers/supplier-type-detail/supplier-type-detail.component';
import { SupplierListComponent } from './suppliers/supplier-list/supplier-list.component';
import { WarehouseListComponent } from './storage/warehouse-list/warehouse-list.component';
import { WorkCenterListComponent } from './production-unit/work-center-list/work-center-list.component';
import { EquipmentListComponent } from './production-unit/equipment-list/equipment-list.component';
import { SaleOrderTypeListComponent } from './sales/sale-order-type-list/sale-order-type-list.component';
import { SaleOrderListComponent } from './sales/sale-order-list/sale-order-list.component';
import { IntentOrderTypeListComponent } from './sales/intent-order-type-list/intent-order-type-list.component';
import { IntentOrderListComponent } from './sales/intent-order-list/intent-order-list.component';
import { PurchaseOrderTypeListComponent } from './procurements/purchase-order-type-list/purchase-order-type-list.component';
import { PurchaseOrderListComponent } from './procurements/purchase-order-list/purchase-order-list.component';
import { PurchaseRequisitionTypeListComponent } from './procurements/purchase-requisition-type-list/purchase-requisition-type-list.component';
import { PurchaseRequisitionListComponent } from './procurements/purchase-requisition-list/purchase-requisition-list.component';
import { AsnTypeListComponent } from './asns/asn-type-list/asn-type-list.component';
import { AsnListComponent } from './asns/asn-list/asn-list.component';
import { ReceivementTypeListComponent } from './receipt/receivement-type-list/receivement-type-list.component';
import { ReceivementListComponent } from './receipt/receivement-list/receivement-list.component';
import { PlanOrderTypeListComponent } from './production/plan-order-type-list/plan-order-type-list.component';
import { PlanOrderListComponent } from './production/plan-order-list/plan-order-list.component';
import { ProductionOrderTypeListComponent } from './production/production-order-type-list/production-order-type-list.component';
import { ProductionOrderListComponent } from './production/production-order-list/production-order-list.component';
import { ArchivesSyncComponent } from './sync/archives-sync/archives-sync.component';
import { DocumentSyncComponent } from './sync/document-sync/document-sync.component';
import { ProductionPlatformComponent } from './pmc/production-platform/production-platform.component';
import { MaterialManagementPlatformComponent } from './pmc/material-management-platform/material-management-platform.component';

const routes: Routes = [
  {
    path: 'basic-archives',
    canActivate: [AuthGuard],
    children: [
      {
        path: 'item-masters',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'item-category-detail',
            component: ItemCategoryDetailComponent,
          },
          {
            path: 'unit-list',
            component: UnitListComponent,
          },
          {
            path: 'unit-group-list',
            component: UnitGroupListComponent,
          },
          {
            path: 'item-master-list',
            component: ItemMasterListComponent,
          },          
          {
            path: 'bill-of-materials-list',
            component: BillOfMaterialsListComponent,
          },
          {
            path: 'bom-master-list',
            component: BomMasterListComponent,
          }
        ],
      },
      {
        path: 'staff',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'department-detail',
            component: DepartmentDetailComponent,
          },
          {
            path: 'operator-list',
            component: OperatorListComponent,
          }
        ],
      },
      {
        path: 'customers',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'customer-type-detail',
            component: CustomerTypeDetailComponent,
          },
          {
            path: 'customer-list',
            component: CustomerListComponent,
          }
        ],
      },
      {
        path: 'suppliers',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'supplier-type-detail',
            component: SupplierTypeDetailComponent,
          },
          {
            path: 'supplier-list',
            component: SupplierListComponent,
          }
        ],
      },
      {
        path: 'storage',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'warehouse-list',
            component: WarehouseListComponent,
          }
        ],
      },
      {
        path: 'production-unit',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'work-center-list',
            component: WorkCenterListComponent,
          },
          {
            path: 'equipment-list',
            component: EquipmentListComponent,
          }
        ],
      },
      {
        path: 'sales',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'sale-order-type-list',
            component: SaleOrderTypeListComponent,
          },
          {
            path: 'sale-order-list',
            component: SaleOrderListComponent,
          },
          {
            path: 'intent-order-type-list',
            component: IntentOrderTypeListComponent,
          },
          {
            path: 'intent-order-list',
            component: IntentOrderListComponent,
          }
        ],
      },
      {
        path: 'procurements',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'purchase-order-type-list',
            component: PurchaseOrderTypeListComponent,
          },
          {
            path: 'purchase-order-list',
            component: PurchaseOrderListComponent,
          },
          {
            path: 'purchase-requisition-type-list',
            component: PurchaseRequisitionTypeListComponent,
          },
          {
            path: 'purchase-requisition-list',
            component: PurchaseRequisitionListComponent,
          }
        ],
      },
      {
        path: 'asns',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'asn-type-list',
            component: AsnTypeListComponent,
          },
          {
            path: 'asn-list',
            component: AsnListComponent,
          }
        ],
      },
      {
        path: 'receipt',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'receivement-type-list',
            component: ReceivementTypeListComponent,
          },
          {
            path: 'receivement-list',
            component: ReceivementListComponent,
          }
        ],
      },
      {
        path: 'production',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'plan-order-type-list',
            component: PlanOrderTypeListComponent,
          },
          {
            path: 'production-order-type-list',
            component: ProductionOrderTypeListComponent,
          },
          {
            path: 'plan-order-list',
            component: PlanOrderListComponent,
          },
          {
            path: 'production-order-list',
            component: ProductionOrderListComponent,
          },
          {
            path: 'production-platform',
            component: ProductionPlatformComponent,
          },
          {
            path: 'material-management-platform',
            component: MaterialManagementPlatformComponent,
          }
        ],
      },
      {
        path: 'sync',
        canActivate: [AuthGuard],
        children: [
          {
            path: 'archives-sync',
            component: ArchivesSyncComponent,
          },
          {
            path: 'document-sync',
            component: DocumentSyncComponent,
          }
        ],
      }
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class BasicArchivesRoutingModule {}
